import Vue from 'vue'
import VueRouter from 'vue-router'
const Home = () => import('../components/Home.vue')
const News = () => import('../components/News.vue')
const Images = () => import('../components/Images.vue')
const Goods = () => import('../components/Goods.vue')
const Vip = () => import('../components/Vip.vue')
const Shopcar = () => import('../components/Shopcar.vue')
const Search = () => import('../components/Search.vue')
const Newlist = () => import('../components/Newlist.vue')
const Detaillist = () => import('../components/DetailList.vue')
const Detail = () => import('../components/Detail.vue')

Vue.use(VueRouter)

const router = new VueRouter({
  routes: [
    { path: '/', redirect: '/home' },
    { path: '/home', component: Home },
    { path: '/newslist', component: News },
    { path: '/photo/list', component: Images },
    { path: '/goods/list', component: Goods },
    { path: '/member', component: Vip },
    { path: '/shopcar', component: Shopcar },
    { path: '/search', component: Search },
    { path: '/news/detail/:id', component: Newlist },
    { path: '/detailList/:id', component: Detaillist },
    { path: '/goods/detail/:id', component: Detail, props: true }
  ]
})

export default router
